﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace CinemaBookingWcfService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "ICinemaWcf" in both code and config file together.
    [ServiceContract]
    public interface ICinemaWcf
    {
        [OperationContract]
        List<CinemaAuditorium> GetAllAuditoriums();
        [OperationContract]
        int GetAuditoriumByScreeningID(int screeningID);

        [OperationContract]
        List<CinemaBookedSeat> GetAllBookedSeats();
        [OperationContract]
        void InsertBooked(int seatID, int screeningID, int orderID);
        [OperationContract]
        void UpdateBooked(int seatID, int screeningID);
        [OperationContract]
        void DeleteBooked(int seatID, int screeningID);
        [OperationContract]
        bool CheckIfBooked(int seatID, int screeningID);

        [OperationContract]
        List<CinemaMovie> GetAllMovies();
        [OperationContract]
        List<CinemaMovie> GetMoviesWhichHasScreeningID();
        [OperationContract]
        CinemaMovie GetMovieById(int id);
        [OperationContract]
        String GetMovieTitleByID(int id);
        [OperationContract]
        void InsertMovie(String MovieTitle, String MovieDescription, double MoviePrice);
        [OperationContract]
        void UpdateMovie(int MovieID, String MovieTitle, String MovieDescription, double MoviePrice);
        [OperationContract]
        void DeleteMovie(int MovieID);

        [OperationContract]
        List<CinemaOrder> GetAllOrders();
        [OperationContract]
        void InsertOrder(String name, int phone);
        [OperationContract]
        int GetOrderID(String name, int phone);
        [OperationContract]
        void UpdateOrder(int id, String name, int phone);
        [OperationContract]
        void DeleteOrder(int id);

        [OperationContract]
        List<CinemaPartOrder> getAllPartOrders();
        [OperationContract]
        List<CinemaPartOrder> getAllPartOrdersOnOrder(int orderID);
        [OperationContract]
        void insertPartOrder(int orderID, int seatID, int screeningID);
        [OperationContract]
        void deletePartOrder(int orderID, int seatID, int screeningID);

        [OperationContract]
        List<CinemaRow> GetAllRows();
        [OperationContract]
        List<CinemaRow> GetRowsByScreeningID(int screeningID);
        [OperationContract]
        int GetRowSize(int id);
        [OperationContract]
        List<CinemaRow> GetRowsByAuditoriumID(int auditoriumID);
        
        [OperationContract]
        List<CinemaScreening> GetAllScreenings();
        [OperationContract]
        void InsertScreening(int movieID, int auditoriumID, DateTime startTime, DateTime endTime);
        [OperationContract]
        void UpdateScreening(int screeningID, int movieID, int auditoriumID, DateTime startTime, DateTime endTime);
        [OperationContract]
        void DeleteScreening(int screeningID);
        [OperationContract]
        List<CinemaScreening> GetScreeningByMovieID(int movieID);
        [OperationContract]
        List<CinemaScreening> GetCurrentScreeningByMovieID(int movieID);

        [OperationContract]
        List<CinemaSeat> GetAllSeats();
        [OperationContract]
        List<CinemaSeat> GetAllSeatsNotBooked(int screeningID);
        [OperationContract]
        List<CinemaSeat> GetRowSeats(int rowID);
        [OperationContract]
        int GetSeatNumberByID(int id);
        [OperationContract]
        int GetSeatIDByNumberRow(int number, int row);
        [OperationContract]
        int GetRowIDBySeatID(int seatID);
        [OperationContract]
        List<CinemaSeat> GetAllSeatsNotBookedByRowID(int screeningID, int rowID);
    }
}
